<%--
  Created by IntelliJ IDEA.
  User: 19254
  Date: 2021/2/28
  Time: 16:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="statics/js/jquery-3.5.1.js"></script>
<body>
<p>
    用户名:<input type="text" id="name" onblur="a()">
    <span id="userInfo"></span>
    密码:<input type="text" id="pwd" onblur="b()">
    <span id="pwdInfo"></span>
</p>
</body>
<script>
    function a() {
        $.post({
            url:"${pageContext.request.contextPath}/a3",
            data:{"name":$("#name").val()},
            success:function (data) {
                if(data.toString()=='ok'){
                    $("#userInfo").css("color","green");
                }else {$("#userInfo").css("color","red");}
                $("#userInfo").html(data)
            }
        })
    };
    function b() {
        $.post({
            url:"${pageContext.request.contextPath}/a3",
            data:{"pwd":$("#pwd").val()},
            success:function (data) {
                if(data.toString()=='ok'){
                    $("#pwdInfo").css("color","green");
                }else{
                    $("#pwdInfo").css("color","red");
                }
                $("#pwdInfo").html(data)
            }
        })
    };
</script>
</html>
